"""
Project Name : api_automation_framework
File Name : logger.py
Author : lldhsds
Date : 2024/12/29 18:52
Description: 实用logging模块记录日志，便于调试和查询测试结果。
"""

import logging

def setup_logger():
    logger = logging.getLogger("APITest")
    logger.setLevel(logging.DEBUG)

    handler = logging.StreamHandler()
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    handler.setFormatter(formatter)
    logger.addHandler(handler)

    return logger
